<!-- OfficeCall Edit -->
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main" />
  <title>Edit Office Call</title>
</head>
<body>
  <div class="body">
    <h1>Edit Office Call</h1>
    <g:render template="/common/flashMessage" />
    <g:render template="/common/beanError" model="[bean:officeCall]" />
    <g:form method="post" >
      <div class="dialog">
        <table>
          <tbody>
            <tr class="prop">
              <td valign="top" class="name">
                <label for="contact">Contact:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:officeCall, field:'contact','errors')}">
                <g:select optionKey="id" from="${officeCall.company.contacts}" name="contact.id" value="${officeCall?.contact?.id}" ></g:select>
              </td>
            </tr>
            <tr class="prop">
              <td valign="top" class="name">
                <label for="salesPerson">Representative:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:officeCall, field:'rep','errors')}">
                <g:select optionKey="id" from="${officeCall.company.reps}" name="rep.id" value="${officeCall?.rep?.id}" ></g:select>
              </td>
            </tr>
            <tr class="prop">
              <td valign="top" class="name">
                <label for="date">Date:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:officeCall, field:'date','errors')}">
                <g:datePicker name="date" value="${officeCall?.date}" precision="minute" ></g:datePicker>
              </td>
            </tr>
            <tr class="prop">
              <td valign="top" class="name">
                <label for="notes">Notes:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:officeCall, field:'notes','errors')}">
                <textarea rows="3" cols="25" name="notes">${fieldValue(bean:officeCall, field:'notes')}</textarea>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <input type="hidden" name="id" value="${officeCall?.id}" />
      <input type="hidden" name="version" value="${officeCall?.version}" />
      <tdcmw:submitFormButton action="save" label="Update" />
    </g:form>
  </div>
</body>